package vashion.azeroth.back.controller.account;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import vashion.azeroth.core.manager.personal.tran.PersonalTranDetailManager;
import vashion.azeroth.core.personal.tran.pojo.PersonalTranDetail;
import vashion.azeroth.core.service.base.BaseService;

@Controller
@RequestMapping("/back/account")
public class AccountDetailController {

	@Autowired
	private PersonalTranDetailManager tranDetailManager;
	
    @RequestMapping("queryAccountDetails.htm")
    public String getDisburseList(Model model, @ModelAttribute("PersonalTranDetail") PersonalTranDetail detail) {
    	
		int totalCount = tranDetailManager.findCnt(detail);
		BaseService page = new BaseService();
		page.initPages(detail, totalCount);
		
		List<PersonalTranDetail> details = tranDetailManager.find(detail);
		
		
		model.addAttribute("details", details);
		model.addAttribute("detail", detail);
		model.addAttribute("page", page);

        return "/account/accountDetailList";
    }
    
}
